package com.fg.cloud.manager.mapper.agency;

import org.apache.ibatis.annotations.Param;

import com.fg.cloud.manager.entry.agency.AgencyUserEntity;
import com.fg.cloud.manager.entry.agency.vo.AgencyInfoVo;
import com.fg.cloud.manager.entry.agency.vo.AgencyUserVo;
import com.fg.cloud.manager.mapper.BaseMapper;

/**
 * 经销商用户Mapper
 * @author around
 * @date 2017-6-21
 */
public interface AgencyUserMapper extends BaseMapper {
	
	long delByfacId(@Param("facId")Long facId);
	
    AgencyUserEntity selectByPrimaryKey(Long id);
    
    AgencyUserVo selectUserByUserName(String userName);

    int deleteByPrimaryKey(Long id);
    
    long updateByVo(AgencyInfoVo agencyUserVo);
    
    long updateStatus(@Param ("userId")Long userId,@Param("facId") Long facId, 
    		@Param ("ids")Long[] ids, @Param ("status")Integer status);
    
    /**
     * Description:修改经销商密码
     * @param id
     * @param oldPassword
     * @param newPassword
     * @return
     * @author around
     * @date 2017年8月23日下午4:51:04
     */
    int resetPassword(@Param ("id")Long id, @Param ("oldPassword")String oldPassword, 
    		@Param ("newPassword")String newPassword);
    
    /**
     * Description:验证唯一性
     * @param id
     * @param name
     * @return
     * @author around
     * @date 2017年8月27日下午5:34:25
     */
    long verifyUniquely(@Param("id")Long id, @Param("name")String name);
    
}